//
//  ST_EngagementCenterInfoView.swift
//  btvideo
//
//  Created by mac on 2021/3/9.
//  Copyright © 2021 JarvanZhang. All rights reserved.
//

import UIKit

enum ST_EngagementCenterInfoType {
    case hidden
    case more_than_a_minute
    case displayGiftHint
    case displayImpression
}


class ST_EngagementCenterInfoView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.backgroundColor = .white
        self.cornerRadius = 24
        self.alpha = 0
        
        self.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.edges.equalToSuperview().inset(UIEdgeInsets.init(top: 0, left: 16, bottom: 0, right: 16))
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private var type = ST_EngagementCenterInfoType.hidden
    
    fileprivate lazy var normal_text = "聊的挺不错？要不要送个礼物表达爱意？"
    
    fileprivate lazy var normal_impression_text = "你们初印象良好，祝遇有缘人！"
    
//    fileprivate lazy var displayGift = false
    
    fileprivate lazy var titleLabel:UILabel = {
        let control = UILabel()
        control.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.medium)
        control.textColor = UIColor.init(hex: 0x333333)
        return control
    }()
    
    
    
    func setCurrentTime(seconds:Int)  {
        
        if seconds < 60 {
            return
        }
        
        
        titleLabel.text = normal_text
        
        self.alpha = 1
        
    }
    
    
    func receive(giftStr:String)  {
        
        titleLabel.text = giftStr
        
        self.alpha = 1
    }
    
    
    func display_impression_hint(){
        
        titleLabel.text = normal_impression_text
        
        self.alpha = 1
        
    }
    
    
}
